package cn.edu.hitwh.kanlema.service.impl;

import cn.edu.hitwh.kanlema.entity.SeckillVoucher;
import cn.edu.hitwh.kanlema.mapper.SeckillVoucherMapper;
import cn.edu.hitwh.kanlema.service.ISeckillVoucherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 秒杀优惠券表，与优惠券是一对一关系 服务实现类
 * </p>
 *
 * @author vvcoder
 * @since 2025-8-18
 */
@Service
public class SeckillVoucherServiceImpl extends ServiceImpl<SeckillVoucherMapper, SeckillVoucher> implements ISeckillVoucherService {

    @Override
    public boolean deductStock(Long voucherId) {
        return baseMapper.deductStock(voucherId) > 0;
    }
}
